Repository navigation
Conversation
X renders a 1200x630 card for every post at https://jf.x.com/images/post/<id>.png and advertises it as og:image to link-preview bots (Slackbot, Twitterbot). Non-bot HTML points og:image at the author avatar or a generic X logo instead, and the syndication-based HTML has no og:image at all, so text-only posts ended up with a weak image or none. Media (jsonld, video poster, tweet photo, link card, real og:image media) still wins. The post card replaces og:image only when that is the avatar or the generic logo, or when it is missing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
What
For
/<user>/status/<id>URLs, metascraper-x now falls back to the card X renders for every post:This is the same image Slack shows when unfurling an X link.
Why
X only puts that card in
og:imagewhen the request comes from a link-preview bot:og:imageSlackbot/Twitterbothttps://jf.x.com/images/post/<id>.pngprofile_images/..._400x400.jpg)Microlink's X syndication provider emits no
og:imageat all for text-only posts, so todayhttps://api.microlink.io/?url=https://x.com/Kikobeats/status/2110627638049910905returnsimage: null.Slack adds nothing on top: the PNG from
slack-imgs.comis byte-identical to the one fromjf.x.com(same sha256), so we point at X directly.Precedence
Media still wins: jsonld image, video poster, tweet photo, link card, and
og:imagewhen it is real media (pbs.twimg.com/media/...,card_img, ...). The post card replacesog:imageonly when that is the avatar (/profile_images/), X's generic logo (/rweb/ssr/default/), or missing. Profile URLs are unchanged.Tests
from a post without media uses the post cardtest with the syndication HTML the API produces (fails on master, image isundefined).pnpm testinpackages/metascraper-x: 20 passed.standardclean.200 image/png. Missing ids return 404.Caveat
jf.x.comis not a documented API. It is what X hands to crawlers today. If X changes it, posts without media go back to the previous image.🤖 Generated with Claude Code
Note
Low Risk
Scoped to X image metadata selection in metascraper-x; relies on undocumented
jf.x.comURLs that could break if X changes crawler behavior.Overview
metascraper-x now derives share images for status URLs via
getShareImage, which still prefers JSON-LD, video posters, and in-page media, but treatsog:imageas real media only when it is not an avatar (/profile_images/) or X’s generic preview (/rweb/ssr/default/). Otherwise it falls back tohttps://jf.x.com/images/post/<statusId>.png, fixing text-only / syndicated posts that omitog:imageor only expose profile/generic images.Tests add syndication HTML without
og:imageand update snapshots so text-only posts expect the post card instead of generic logo or avatar URLs.Reviewed by Cursor Bugbot for commit 03be303. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit